package com.rental.common.util;

import com.rental.common.exception.ProjectException;
import com.rental.common.result.AjaxResult;

public class AjaxResultHandler {

    public static <T> T handle(AjaxResult<T> ajaxResult) {
        if (ajaxResult.getCode() != 200) throw new ProjectException(ajaxResult.getCode(), ajaxResult.getMessage());
        return ajaxResult.getData();
    }
}
